]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnail: Initialize porthole to work area
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 2 Mar 2021 10:45:31 +0000 (11:45 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 2 Mar 2021 21:56:30 +0000 (21:56 +0000)
We currently initialize the porthole to the screen size instead of
the monitor's work area we actually want. At the moment this doesn't
matter, as the minimap is created during initialization with the rest
of the overview, so we can expect a work area change that updates the
porthole to the correct values.

That won't be true for minimaps we put on secondary monitors, so make
sure we initialize the porthole to the actual values.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1735>

js/ui/workspaceThumbnail.js

index 793a101548a18150c72b55b6202426c5a4715003..fb25f6cb1fca5f08ef01ce31cde72a406264d9c4 100644 (file)
@@ -641,10 +641,6 @@ var ThumbnailsBox = GObject.registerClass({
         this._indicator = indicator;
         this.add_actor(indicator);
 
-        // The porthole is the part of the screen we're showing in the thumbnails
-        this._porthole = { width: global.stage.width, height: global.stage.height,
-                           x: global.stage.x, y: global.stage.y };
-
         this._dropWorkspace = -1;
         this._dropPlaceholderPos = -1;
         this._dropPlaceholder = new St.Bin({ style_class: 'placeholder' });
@@ -696,8 +692,10 @@ var ThumbnailsBox = GObject.registerClass({
                     this._createThumbnails();
             });
 
+        // The porthole is the part of the screen we're showing in the thumbnails
         this._workareasChangedId = global.display.connect('workareas-changed',
             () => this._updatePorthole());
+        this._updatePorthole();
 
         this.connect('notify::visible', () => {
             if (!this.visible)